package com.aier.user.service;

import java.util.List;
import java.util.Map;

import com.aier.user.entity.Follow;
import com.aier.user.entity.Fresh;
import com.aier.user.entity.FreshComment;
import com.aier.user.entity.FreshFavorite;
import com.aier.user.entity.FreshPraise;



public interface IHomeForumsService {
    
    /**
     * 发布新鲜事
     * @param uid
     * @param content
     * @param img
     * @param special
     * @param power
     * @param agid
     * @return
     */
    int insertFresh(Long uid,String content,String img,String special,Short power,Long fgid);
    
    /**
     * 转发新鲜事
     * @param uid
     * @param content
     * @param special
     * @param power
     * @param agid
     * @param relativeid
     * @return
     */
    int insertOtherFresh(Long uid,String content,String special,Short power,Long fgid,Long fid,int cflag);
    
    /**
     * 评论新鲜事
     * @param uid
     * @param fid
     * @param content
     * @return
     */
    int insertFreshComment(Long uid,Long fid,Long rfcuid,String content,String rcontent,Short ctype,int flag,int cflag,String special);
    
    /**
     * 浏览新鲜事
     * @param fid
     * @return
     */
    int updateFreshBcount(Long fid);
    
    /**
     * 赞或取消赞
     * @param fid
     * @param ptype
     * @return
     */
    int updateFreshPraise(Long uid,Long fid,int ptype);
    
    /**
     * 收藏新鲜事
     * @param uid
     * @param fid
     * @return
     */
    int insertFavoriteFresh(Long uid,Long fid);
    
    /**
     * 获取所有收藏
     * @param uid
     * @return
     */
    Map<String, Object> searchFavorite(int page,int pagesize,Long uid);
    
    /**
     * 取消收藏
     * @param ffid
     * @return
     */
    int deleteFavoriteFresh(Long ffid);
    
    /**
     * 根据uid和fid取消收藏
     * @param uid
     * @param fid
     * @return
     */
    int deleteFFByUid(Long uid,Long fid);
    
    /**
     * 获取所有的关注列表
     * @return
     */
    List<Follow> searchAllFollow(Long uid);
    
    /**
     * 分页获取新鲜事
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchAllFresh(int page,int pagesize,Long uid);
    
    /**
     * 根据fid查询新鲜事
     * @param fid
     * @return
     */
    Fresh searchFresh(Long fid,int type);
    
    /**
     * 分页获取密友圈的新鲜事
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchFriendFresh(int page,int pagesize,Long uid);
    
    /**
     * 查询某一条新鲜事的评论
     * @param fid
     * @return
     */
    Map<String,Object> searchCommentByFid(int page,int pagesize,Long fid);
    
    /**
     * 查询收到的评论
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchReceiveComment(int page,int pagesize,Long uid);
    
    /**
     * 查询发出的评论
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchSendComment(int page,int pagesize,Long uid);
    
    /**
     * 根据fcid查询评论的具体内容
     * @param fcid
     * @return
     */
    FreshComment searchFreshCommentByFcid(Long fcid);
    
    /**
     * 获取我的新鲜事的赞
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchPraiseAllFresh(int page,int pagesize,Long uid);
    
    /**
     * 删除评论或回复
     * @param fcid
     * @param flag
     * @return
     */
    int deleteComment(Long fcid);
    
    /**
     * 提到我的新鲜事
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchSpecialFresh(int page,int pagesize,Long uid);
    
    /**
     * 提到我的评论
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchSpecialComment(int page,int pagesize,Long uid);
    
    /**
     * 获取关注的动态
     * @return
     */
    Map<String,Object> searchFollowDo(int page,int pagesize,Long uid);
    
    /**
     * 获取密友的动态
     * @param uid
     * @return
     */
    Map<String,Object> searchFriendDo(int page,int pagesize,Long uid);
    
    /**
     * 查询此用户是否赞过某条新鲜事
     * @param uid
     * @param fid
     * @return
     */
    FreshPraise searchPraiseByCon(Long uid, Long fid);
    
    /**
     * 查询此用户是否收藏过某天新鲜事
     * @param uid
     * @param fid
     * @return
     */
    FreshFavorite searchFavoriteByCon(Long uid, Long fid);
    
    /**
     * 删除新鲜事
     * @param hid
     * @return
     */
    int deleteFresh(Long fid);
    
    /**
     * 分页获本人的新鲜事
     * @param page
     * @param pagesize
     * @param uid
     * @return
     */
    Map<String,Object> searchFreshSelf(int page,int pagesize,Long uid);
    
}
